package cc.wsyw126.java.nowcoder;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/4/12.
 */
public class NumberOfDivisible {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String s = scanner.nextLine();
            String[] split = s.split(" ");
            int a = Integer.parseInt(split[0]), b = Integer.parseInt(split[1]), c = Integer.parseInt(split[2]);
            int result = 0;
            int resulta = Math.abs(a / c) + 1, resultb = Math.abs(b / c) + 1;
            if (a == 0) {
                result = resultb;
            } else if (b == 0) {
                result = resulta;
            } else if ((a > 0 && b > 0) || (a < 0 && b < 0)) {
                result = Math.abs(resulta - resultb);
            } else {
                result = resulta + resultb - 1;
            }
            System.out.println(result);
        }
    }
}
